<h1 class="page-header">
    <small>会话管理</small>
</h1>
<hr/>
<h3>当前在线: &nbsp;${sessionCount} 人</h3>
<div class="panel panel-inverse" data-sortable-id="table-basic-4">
    <div class="panel-heading">
        <h4 class="panel-title">会话列表</h4>
    </div>
    <div class="panel-body">
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
            <tr>
                <th>会话ID</th>
                <th>用户名称</th>
                <th>主机地址</th>
                <th>最后访问时间</th>
                <th>已经强制退出</th>
                <th>操作</th>
            </tr>
            </tbody>
            <#if sessions?has_content && sessionCount gt 0>
                <#list sessions as session>
                    <#if session != null && sessionUtil.principal(session) != "">
                    <tr>
                        <td>${session.id}</td>
                        <td>${sessionUtil.principal(session)}</td>
                        <td>${session.host}</td>
                        <td>${session.lastAccessTime?string("yyyy-MM-dd HH:mm")}</td>
                        <td>
                            <#if sessionUtil.isForceLogout(session)>
                                是
                                <#else>
                                    否
                            </#if>
                        </td>
                        <td>
                            <#if  shiroUserHelper.getCurrentShiroUser().acctName != sessionUtil.principal(session)>
                                <a href="javascript:getConfirmData('确定踢出该账户会话吗?','${rc.contextPath}/sessions/forceLogout/${session.id}','displayArea')">踢出</a>
                            </#if>
                        </td>
                    </tr>
                    </#if>
                </#list>
            </#if>
        </table>
    </div>